package com.clock.web.controller.shop;

import com.clock.common.core.controller.BaseController;
import com.clock.common.core.domain.AjaxResult;
import com.clock.common.core.page.TableDataInfo;
import com.clock.shop.domain.ShopOrder;
import com.clock.shop.domain.ShopService;
import com.clock.shop.domain.vo.DataVo;
import com.clock.shop.domain.vo.ShopOrderVo;
import com.clock.shop.domain.vo.ShopServiceVo;
import com.clock.shop.service.IShopAppointedService;
import com.clock.shop.service.IShopEmployeeService;
import com.clock.shop.service.IShopOrderService;
import com.clock.shop.service.IShopMemberService;
import com.clock.shop.service.IShopServiceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 收银Controller
 *
 * @author ruoyi
 * @date 2024-10-12
 */
@RestController
@RequestMapping("/shop/Cashier")
public class ShopCashierController extends BaseController
{

    @Autowired
    private IShopOrderService iShopOrderService;

    @Autowired
    private IShopAppointedService iShopAppointedService;

    @Autowired
    private IShopEmployeeService iShopEmployeeService;

    @Autowired
    private IShopMemberService iShopMemberService;

    /**
     * 查询流水-数据
     */
    @PreAuthorize("@ss.hasPermi('system:order:list')")
    @GetMapping("/selectData")
    public AjaxResult selectData(Long shopId)
    {
        System.out.println(shopId);
        DataVo dataVo = new DataVo();
        dataVo.setOrderNum(iShopOrderService.selectOrderNum(shopId));//查总订单数
        dataVo.setAppointedNum(iShopAppointedService.selectAppointedNum(shopId));//查总预约单数
        dataVo.setMemberNum(iShopMemberService.selectMemberNum(shopId));//查总会员数
        dataVo.setTotalMoney(iShopOrderService.selectTotalMoney(shopId));//查订单总金额

        dataVo.setTodayOrder(iShopOrderService.selectTodayOrder(shopId));//查今日订单数
        dataVo.setTodayMoney(iShopOrderService.selectTodayMoney(shopId));//查今日金额
        dataVo.setMonthOrder(iShopOrderService.selectMonthOrder(shopId));//查本月订单数
        dataVo.setMonthMoney(iShopOrderService.selectMonthMoney(shopId));//查本月金额
        return success(dataVo);
    }

}
